#pragma once
#include "../DeadlyShadowsLastHope\Entity.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../SGD Wrappers/CSGD_XAudio2.h"
#include "../DeadlyShadowsLastHope/IListener.h"
#include "../DeadlyShadowsLastHope\EventSystem.h"
#include "../DeadlyShadowsLastHope\MessageSystem.h"
#include "../DeadlyShadowsLastHope/NEvent.h"
#include "../AnimationManager.h"

class CEnemy : public CEntity , public IListener
{
private:
	CSGD_Direct3D*			m_pD3D;
	CSGD_DirectInput*		m_pDI;
	CSGD_XAudio2*			m_pXA;
	CSGD_TextureManager*	m_pTM;
	CMessageSystem*			m_pMS;
	CAnimationManager*		m_pAM;
	CEventSystem*			m_pES;

	CAnimationMenu			m_cAniInfo;	

	bool m_bOnPlatform;
	CEntity* m_pTarget;
	int m_nHealth;
	bool m_bFaceing;
	bool m_battack;
	float m_fTimer;
	float m_fAttackTimer;
	int m_nSpeedoffset;

public:
//Inherited from CEntity///////////////////////////////
	virtual void Update	(float fElapsedTime);
	virtual void Render	(void);
	virtual RECT GetRect(void) const;
	virtual bool CheckCollision( IEntity* pOther );
///////////////////////////////////////////////////////

	CEnemy(void);
	~CEnemy(void);

	bool Init(CEntity* pTarget,int x,int y,int speedset);
	void OnPlatform(bool bPlatform){ m_bOnPlatform = bPlatform; }
	bool OnPlatform(void)const{ return m_bOnPlatform; }

	virtual void HandleEvent(CNEvent* pEvent) =0;
	
	void SetHealth(int nHealth){ m_nHealth = nHealth; }
	int GetHealth(void)const{ return m_nHealth; }
	bool GetFacing(void){ return m_bFaceing; }
	void SetFacing(bool face){ m_bFaceing=face; }

};